#include "header.hpp"
int main()
{
//1.创建key
key_t k=Getkey();
cout<<"k:"<<k<<endl;

//2.创建共享内存
int shmid=Getshm(k,SIZE);
cout<<"共享内存id:"<<shmid<<endl;

//3.关联共享内存
char* shmaddr=attachshm(shmid);

//4.通信
  int i = 0;
    char c='A';
    while (i < 26)
    {
        shmaddr[c-'A']=c;
        c++;
        shmaddr[c-'A']='\0';
        i++;
        sleep(1);
    }




//5.取消关联
deatchshm(shmaddr);




    return 0;
}